﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Linq;

namespace CoderJoe.WoW.GearManager.Views
{
	public partial class LoadCharacterDialog : Form
	{
		protected LoadCharacterController Controller { get; private set; }

		public LoadCharacterDialog(LoadCharacterController controller)
		{
			Controller = controller;

			InitializeComponent();
		}

		protected override void OnLoad(EventArgs e)
		{
			this.nameTextBox.DataBindings.Add("Text", Controller.Model, "Name");
			this.realmComboBox.DataSource = Controller.Model.Realms.ToList();
			this.realmComboBox.DataBindings.Add("Text", Controller.Model, "Realm");

			base.OnLoad(e);
		}

		private void Button_Click(object sender, EventArgs e)
		{
			Button button = (Button)sender;
			this.DialogResult = button.DialogResult;
			this.Close();
		}
	}
}
